package com.zwh.sharding.modules.service;

import java.util.List;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zwh.sharding.modules.dao.XxlJobUserDao;
import com.zwh.sharding.modules.entity.XxlJobUser;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;


/**
 * @author zwh
 * @date 2023-5-11
 */

@Service
@Transactional(readOnly = true)
public class XxlJobUserService extends ServiceImpl<XxlJobUserDao, XxlJobUser> {

    public Page<XxlJobUser> pageList(Page<XxlJobUser> page, XxlJobUser entity){
        QueryWrapper<XxlJobUser> queryWrapper=new QueryWrapper<>(entity);
        queryWrapper.orderByAsc("id");
        return this.page(page, queryWrapper); //service内置分页查询方法
    }

    /**
     * 分页查询数据
     * 不查询大字段信息
     * @param entity
     */
    public List<XxlJobUser> findSimpleList(XxlJobUser entity){
        QueryWrapper<XxlJobUser> queryWrapper=new QueryWrapper<>(entity);
        List<XxlJobUser> list= this.list(queryWrapper); //service内置分页查询方法
        return list;
    }

    public List<XxlJobUser> findSimpleList2(XxlJobUser entity){
        QueryWrapper<XxlJobUser> queryWrapper=new QueryWrapper<>(entity);
        List<XxlJobUser> list= this.list(queryWrapper); //service内置分页查询方法
        return list;
    }
}
